package com.yuntsg.ruiijn.controller.admin;


import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import cn.hutool.db.ds.simple.SimpleDataSource;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuntsg.ruiijn.controller.system.InitController;
import com.yuntsg.ruiijn.database.entity.SysCopyRecord;
import com.yuntsg.ruiijn.database.entity.UnitBasic;
import com.yuntsg.ruiijn.database.entity.WosBasic;
import com.yuntsg.ruiijn.database.mapper.SysCopyRecordMapper;
import com.yuntsg.ruiijn.database.mapper.UnitBasicMapper;
import com.yuntsg.ruiijn.database.mapper.WosBasicMapper;
import com.yuntsg.ruiijn.database_entity.WosEntity;
import com.yuntsg.ruiijn.databse_search.entity.FileDetails;
import com.yuntsg.ruiijn.databse_search.service.FileDetailService;
import com.yuntsg.ruiijn.databse_search.service.FileRecordsService;
import com.yuntsg.nnsfcp.common.beans.ResultBean;
import common.util.AesEncryptUtils;
import common.util.StringUtil;
import com.yuntsg.nnsfcp.common.utils.UserUtil;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.sql.DataSource;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

import static com.yuntsg.ruiijn.JiaXinZhi.InfoGetRuleName.getRuleName;

@RestController
@RequestMapping("admin_copy_record")
@Slf4j
@SuppressWarnings("ALL")
//@Api(tags = "科室规范")
public class AdminCopyRecordController {

    @Resource
    private FileDetailService fileDetailService;
    @Resource
    private FileRecordsService fileRecordsService;
    @Resource
    private WosBasicMapper wosBasicMapper;
    @Resource
    private SysCopyRecordMapper copyRecordMapper;
    @Resource
    private UnitBasicMapper unitBasicMapper;
    @Resource
    private WosBasicController wosBasicController;
    @Resource
    private InitController initController;
    @Resource
    private UserUtil userUtil;

    ////////@ApiOperation("获取年份下拉菜单")
    @GetMapping("/unit_year")

    public ResultBean<Object> unit_year() {
        List<SysCopyRecord> list = new LambdaQueryChainWrapper<>(copyRecordMapper).select(SysCopyRecord::getYear).list();
        List<SysCopyRecord> sortedList = list.stream()
                .distinct()
                .sorted(Comparator.comparing(SysCopyRecord::getYear))
                .collect(Collectors.toList());
        return new ResultBean<>(sortedList);
    }


    ////////@ApiOperation("获取基金和单位的下拉菜单")
    @GetMapping("/unit_fund")

    public ResultBean<Object> unit_fund() {
        List<SysCopyRecord> list = new LambdaQueryChainWrapper<>(copyRecordMapper).select(SysCopyRecord::getSearchList).list();
        Map<String, Integer> map = new HashMap<>();
        for (SysCopyRecord sysCopyRecord : list) {
            String searchList = sysCopyRecord.getSearchList();
            List<String> array = JSONObject.parseArray(searchList, String.class);
            for (String s : array) {
                if (map.containsKey(s)) {
                    map.put(s, map.get(s) + 1);
                } else {
                    map.put(s, 1);
                }
            }
        }

        List<Map.Entry<String, Integer>> sortedEntries = map.entrySet().stream()
                .sorted(Map.Entry.<String, Integer>comparingByValue(Comparator.reverseOrder()))
                .collect(Collectors.toList());

        Map<String, Integer> reversedMap = new LinkedHashMap<>();
        for (Map.Entry<String, Integer> entry : sortedEntries) {
            reversedMap.put(entry.getKey(), entry.getValue());
        }

        return new ResultBean<>(reversedMap);
    }

    ////////@ApiOperation("规范数据")
    @GetMapping("/check")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id"),
//            @ApiImplicitParam(name = "type", value = "1第一作者[A] 2第一参与[A] 3第一通讯[A] 4参与通讯[A] 5基金[A] 6第一作者[B] 7第一参与[B] 8第一通讯[B] 9参与通讯[B] 10基金[B]"),
//            @ApiImplicitParam(name = "param", value = "规范后的名字,以ARECORDA分割"),
//    })
    public ResultBean<Object> check(Integer id, Integer type, String param) {
        List<String> objectList = new ArrayList<>();
        objectList.addAll(Arrays.asList(param.split("ARECORDA")));
        SysCopyRecord one = copyRecordMapper.selectById(id);
        if (type == 1) {
            one.setCoCo(JSONObject.toJSONString(objectList));
        } else if (type == 2) {
            one.setCoCy(JSONObject.toJSONString(objectList));
        } else if (type == 3) {
            one.setRpCo(JSONObject.toJSONString(objectList));
        } else if (type == 4) {
            one.setRpCy(JSONObject.toJSONString(objectList));
        } else if (type == 5) {
            one.setFu(JSONObject.toJSONString(objectList));
        } else if (type == 6) {
            one.setCoCoSo(JSONObject.toJSONString(objectList));
        } else if (type == 7) {
            one.setCoCySo(JSONObject.toJSONString(objectList));
        } else if (type == 8) {
            one.setRpCoSo(JSONObject.toJSONString(objectList));
        } else if (type == 9) {
            one.setRpCySo(JSONObject.toJSONString(objectList));
        } else if (type == 10) {
            one.setFuSo(JSONObject.toJSONString(objectList));
        }
        copyRecordMapper.updateById(one);

        Set<String> searchSet = new HashSet<>();

        searchSet.addAll(JSONObject.parseArray(one.getCoCo(), String.class));
        searchSet.addAll(JSONObject.parseArray(one.getCoCy(), String.class));

        searchSet.addAll(JSONObject.parseArray(one.getRpCo(), String.class));
        searchSet.addAll(JSONObject.parseArray(one.getRpCy(), String.class));

        searchSet.addAll(JSONObject.parseArray(one.getFu(), String.class));

        searchSet.addAll(JSONObject.parseArray(one.getCoCoSo(), String.class));
        searchSet.addAll(JSONObject.parseArray(one.getCoCySo(), String.class));

        searchSet.addAll(JSONObject.parseArray(one.getRpCoSo(), String.class));
        searchSet.addAll(JSONObject.parseArray(one.getRpCySo(), String.class));

        searchSet.addAll(JSONObject.parseArray(one.getFuSo(), String.class));

        one.setSearchList(JSONObject.toJSONString(searchSet));

        copyRecordMapper.updateById(one);

        return new ResultBean<>("操作成功");
    }


    ////////@ApiOperation("查询所有数据")
    @GetMapping("/list")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "page", value = "当前页", defaultValue = "1"),
//            @ApiImplicitParam(name = "limit", value = "每页显示条数", defaultValue = "10"),
//            @ApiImplicitParam(name = "unitName", value = "单位/基金名字"),
//            @ApiImplicitParam(name = "fundName", value = "单位/基金名字"),
//            @ApiImplicitParam(name = "year", value = "年份限定"),
//            @ApiImplicitParam(name = "type", value = "1篇内 2全网"),
//    })
    public ResultBean<Object> list(Integer page, Integer limit, Integer type, Integer year, String unitName, String fundName) {
//        Page<SysCopyRecord> recordPage = new LambdaQueryChainWrapper<>(copyRecordMapper)
//                .eq(null != year, SysCopyRecord::getYear, year)
//                .eq(null != type, SysCopyRecord::getType, type)
//                .last(StringUtil.isNotNull(unitName), "WHERE 1=1 AND    JSON_CONTAINS(search_list, CAST('[\"" + unitName + "\"]' AS JSON)) ")
//                .page(new Page<>(page, limit));

        LambdaQueryChainWrapper<SysCopyRecord> queryChainWrapper = new LambdaQueryChainWrapper<>(copyRecordMapper);
        queryChainWrapper.eq(null != year, SysCopyRecord::getYear, year);
        queryChainWrapper.eq(null != type, SysCopyRecord::getType, type);
        if (StringUtil.isNotNull(year) || StringUtil.isNotNull(type)) {
            queryChainWrapper.last(StringUtil.isNotNull(unitName), " AND  JSON_CONTAINS(search_list, CAST('[\"" + unitName + "\"]' AS JSON)) ");
        } else {
            queryChainWrapper.last(StringUtil.isNotNull(unitName), " WHERE   JSON_CONTAINS(search_list, CAST('[\"" + unitName + "\"]' AS JSON)) ");
        }

        if (StringUtil.isNotNull(year) || StringUtil.isNotNull(type) || StringUtil.isNotNull(unitName)) {
            queryChainWrapper.last(StringUtil.isNotNull(fundName), " AND  JSON_CONTAINS(search_list_fu, CAST('[\"" + fundName + "\"]' AS JSON)) ");
        } else {
            queryChainWrapper.last(StringUtil.isNotNull(fundName), " WHERE   JSON_CONTAINS(search_list_fu, CAST('[\"" + fundName + "\"]' AS JSON)) ");
        }


        Page<SysCopyRecord> recordPage = queryChainWrapper.page(new Page<>(page, limit));


        for (SysCopyRecord record : recordPage.getRecords()) {

            record.setCoCoStr(JSONObject.parseArray(record.getCoCo(), String.class));
            record.setCoCoYsStr(JSONObject.parseArray(record.getCoCoYs(), String.class));

            record.setCoCyStr(JSONObject.parseArray(record.getCoCy(), String.class));
            record.setCoCyYsStr(JSONObject.parseArray(record.getCoCyYs(), String.class));

            record.setRpCoStr(JSONObject.parseArray(record.getRpCo(), String.class));
            record.setRpCoYsStr(JSONObject.parseArray(record.getRpCoYs(), String.class));

            record.setRpCyStr(JSONObject.parseArray(record.getRpCy(), String.class));
            record.setRpCyYsStr(JSONObject.parseArray(record.getRpCyYs(), String.class));

            record.setFuStr(JSONObject.parseArray(record.getFu(), String.class));
            record.setFuYsStr(JSONObject.parseArray(record.getFuYs(), String.class));

            record.setCoCoSoStr(JSONObject.parseArray(record.getCoCoSo(), String.class));
            record.setCoCoSoYsStr(JSONObject.parseArray(record.getCoCoSoYs(), String.class));

            record.setCoCySoStr(JSONObject.parseArray(record.getCoCySo(), String.class));
            record.setCoCySoYsStr(JSONObject.parseArray(record.getCoCySoYs(), String.class));

            record.setRpCoSoStr(JSONObject.parseArray(record.getRpCoSo(), String.class));
            record.setRpCoSoYsStr(JSONObject.parseArray(record.getRpCoSoYs(), String.class));


            record.setRpCySoStr(JSONObject.parseArray(record.getRpCySo(), String.class));
            record.setRpCySoYsStr(JSONObject.parseArray(record.getRpCySoYs(), String.class));

            record.setFuSoStr(JSONObject.parseArray(record.getFuSo(), String.class));
            record.setFuSoYsStr(JSONObject.parseArray(record.getFuSoYs(), String.class));


        }
        return new ResultBean<>(recordPage);
    }


    /**
     * 增加抄袭标记
     */
    ////////@ApiOperation(value = "将抄袭数据添加进记录")
    @GetMapping("add")
    public ResultBean<Object> add(Integer leftId, Integer rightId) {
        try {
            Set<String> searchSet = new HashSet<>();
            Set<String> searchSetFu = new HashSet<>();
            List<String> objectList = new ArrayList<>();
            FileDetails fileDetails = fileDetailService.getById(leftId);
            Integer integer = fileDetails.getRid();//1
            WosBasic wosBasic = new LambdaQueryChainWrapper<>(wosBasicMapper).eq(WosBasic::getRid, integer).last("limit 1").one();
            String ut1 = wosBasic.getCUt();
            wosBasic.setCopyFlagAdm(1);
            System.out.println("修改WOS数据抄袭标志");
            wosBasicMapper.updateById(wosBasic);
            UnitBasic unitBasic = unitBasicMapper.selectById(wosBasic.getGid());
            String unitName = unitBasic.getUnitName();
            SysCopyRecord sysCopyRecord = new SysCopyRecord();
            sysCopyRecord.setUserId(userUtil.getUid());
            sysCopyRecord.setUserName(userUtil.getUserName());
            sysCopyRecord.setTi(wosBasic.getCTi());
            sysCopyRecord.setWosId(wosBasic.getId());

            String c1 = WosBasicController.getC1(wosBasic.getCC1());
            String ciUnit = getRuleName(c1, initController.unitRuleFile);

            //A设置第一作者_规范数据
            objectList.add(ciUnit);
            sysCopyRecord.setCoCo(JSONObject.toJSONString(objectList));
            objectList.clear();
            //A设置第一作者_原始数据
            objectList.add(c1);
            sysCopyRecord.setCoCoYs(JSONObject.toJSONString(objectList));
            objectList.clear();
            //A设置第一参与_规范数据
            List<String> cyList = wosBasicController.getCyList(wosBasic.getCC1());
            sysCopyRecord.setCoCy(JSONObject.toJSONString(cyList));
            //A设置第一参与_原始数据
            List<String> cyYsList = wosBasicController.getCyYsList(wosBasic.getCC1());
            sysCopyRecord.setCoCyYs(JSONObject.toJSONString(cyYsList));

            searchSet.add(ciUnit);
            searchSet.addAll(cyList);

            List<String> rpList = wosBasicController.getRpList(wosBasic.getCRp());
            searchSet.addAll(rpList);
            if (rpList.size() > 0) {
                //A设置第一通讯_规范数据
                List<String> list = new ArrayList<>();
                list.add(rpList.get(0));
                sysCopyRecord.setRpCo(JSONObject.toJSONString(list));

                //A设置参与通讯_规范数据
                rpList.remove(0);
                sysCopyRecord.setRpCy(JSONObject.toJSONString(rpList));
            }

            List<String> rpListYs = wosBasicController.getRpListYs(wosBasic.getCRp());
            if (rpListYs.size() > 0) {
                //A设置第一通讯_原始数据
                List<String> list = new ArrayList<>();
                list.add(rpListYs.get(0));
                sysCopyRecord.setRpCoYs(JSONObject.toJSONString(list));
                //A设置参与通讯_原始数据
                rpListYs.remove(0);
                sysCopyRecord.setRpCyYs(JSONObject.toJSONString(rpListYs));
            }
            //A设置设置基金_规范数据
            String cFu = wosBasic.getCFu();
            if (StringUtil.isNotNull(cFu)) {
                String[] split = cFu.split(";");
                //A设置设置基金_原始数据
                objectList.addAll(Arrays.asList(split));
                sysCopyRecord.setFuYs(JSONObject.toJSONString(objectList));
                objectList.clear();
                for (String fuOne : split) {
                    String ruleName = getRuleName(fuOne, initController.fundRuleFile);
                    objectList.add(ruleName);
                }
                sysCopyRecord.setFu(JSONObject.toJSONString(objectList));
                objectList.clear();
            }


            sysCopyRecord.setYear(wosBasic.getCPy());

            /**
             * 开始记录抄袭的文章信息
             */

            String pmid = "";


            FileDetails fileDetailsRight = fileDetailService.getById(rightId);
            FileDetails father = fileDetailService.getById(fileDetailsRight.getFId());

            if (null != fileDetailsRight.getPmid() && fileDetailsRight.getPmid().length() > 10) {
                pmid = fileDetailsRight.getPmid();
            } else {
                if (father.getTpye() != 3 && father.getTpye() != 4 && father.getTpye() != 2) {
                    father = fileDetailService.getById(father.getFId());
                }
                pmid = Optional.ofNullable(father.getPmid()).orElse("0");
            }

            if (pmid != "0") {
                pmid = AesEncryptUtils.decrypt(pmid);
            }

            FileDetails fileDetailsSo = fileDetailService.getById(rightId);

            if (pmid == wosBasic.getCPm()) {
                sysCopyRecord.setType(1);
                sysCopyRecord.setUnitName(ut1 + "#" + ut1);
                Long count = new LambdaQueryChainWrapper<>(copyRecordMapper).eq(SysCopyRecord::getUnitName, ut1 + "#" + ut1).count();
                if (count != 0) {
                    return new ResultBean<>();
                }
                sysCopyRecord.setTiSo(wosBasic.getCTi());
                //B设置第一作者_规范数据
                objectList.add(ciUnit);
                sysCopyRecord.setCoCoSo(JSONObject.toJSONString(objectList));
                objectList.clear();
                //B设置第一作者_原始数据
                objectList.add(c1);
                sysCopyRecord.setCoCoSoYs(JSONObject.toJSONString(objectList));
                objectList.clear();

                //B设置第一参与_规范数据
                sysCopyRecord.setCoCySo(JSONObject.toJSONString(cyList));
                //B设置第一参与_原始数据
                sysCopyRecord.setCoCySoYs(JSONObject.toJSONString(cyYsList));


                List<String> rpListSo = wosBasicController.getRpList(wosBasic.getCRp());

                if (rpListSo.size() > 0) {
                    //B设置第一通讯_规范数据
                    List<String> list = new ArrayList<>();
                    list.add(rpListSo.get(0));
                    sysCopyRecord.setRpCoSo(JSONObject.toJSONString(list));
                    //B设置参与通讯_规范数据
                    rpListSo.remove(0);
                    sysCopyRecord.setRpCySo(JSONObject.toJSONString(rpListSo));
                }

                List<String> rpListYsSo = wosBasicController.getRpListYs(wosBasic.getCRp());
                if (rpListYsSo.size() > 0) {
                    //B设置第一通讯_原始数据
                    List<String> list = new ArrayList<>();
                    list.add(rpListYsSo.get(0));
                    sysCopyRecord.setRpCoSoYs(JSONObject.toJSONString(list));
                    //B设置参与通讯_原始数据
                    rpListYsSo.remove(0);
                    sysCopyRecord.setRpCySoYs(JSONObject.toJSONString(rpListYsSo));
                }
                //B设置基金_规范数据
                if (StringUtil.isNotNull(cFu)) {
                    String[] split = cFu.split(";");
                    //A设置设置基金_原始数据
                    objectList.addAll(Arrays.asList(split));
                    sysCopyRecord.setFuSoYs(JSONObject.toJSONString(objectList));
                    objectList.clear();
                    for (String fuOne : split) {
                        String ruleName = getRuleName(fuOne, initController.fundRuleFile);
                        if (StringUtil.isNotNull(ruleName)) {
                            objectList.add(ruleName);
                            searchSetFu.add(ruleName);
                        }

                    }
                    sysCopyRecord.setFuSo(JSONObject.toJSONString(objectList));
                    objectList.clear();
                }
                //B设置年份
                sysCopyRecord.setYearSo(wosBasic.getCPy());

            } else {


                //如果是不同来源 C 全网
                sysCopyRecord.setType(2);
                WosEntity wosEntity = wosMsg(pmid);

                String ut2 = wosEntity.getCut();

                sysCopyRecord.setUnitName(ut1 + "#" + ut2);

                Long count1 = new LambdaQueryChainWrapper<>(copyRecordMapper).eq(SysCopyRecord::getUnitName, ut1 + "#" + ut2).count();
                Long count2 = new LambdaQueryChainWrapper<>(copyRecordMapper).eq(SysCopyRecord::getUnitName, ut2 + "#" + ut1).count();

                if (count1 != 0 || count2 != 0) {
                    return new ResultBean<>();
                }

                if (null != wosEntity) {
                    sysCopyRecord.setTiSo(wosEntity.getCTi());
                    String c1So = WosBasicController.getC1(wosEntity.getCco());
                    String ciUnitSo = getRuleName(c1, initController.unitRuleFile);
                    //C设置第一作者_规范数据
                    objectList.add(ciUnitSo);
                    sysCopyRecord.setCoCoSo(JSONObject.toJSONString(objectList));
                    objectList.clear();

                    //C设置第一作者_原始数据
                    objectList.add(c1So);
                    sysCopyRecord.setCoCoSoYs(JSONObject.toJSONString(objectList));
                    objectList.clear();

                    searchSet.add(ciUnitSo);
                    //C设置第一参与_规范数据
                    List<String> listCoCoSo = wosBasicController.getCyList(wosEntity.getCco());
                    sysCopyRecord.setCoCySo(JSONObject.toJSONString(listCoCoSo));
                    searchSet.addAll(listCoCoSo);
                    //C设置第一参与_原始数据
                    List<String> listYs = wosBasicController.getCyYsList(wosEntity.getCco());
                    sysCopyRecord.setCoCySoYs(JSONObject.toJSONString(listYs));


                    List<String> rpListSo = wosBasicController.getRpList(wosEntity.getCrp());
                    searchSet.addAll(rpListSo);

                    if (rpListSo.size() > 0) {
                        //C设置第一通讯_规范数据
                        List<String> list = new ArrayList<>();
                        list.add(rpListSo.get(0));
                        sysCopyRecord.setRpCoSo(JSONObject.toJSONString(list));
                        //C设置参与通讯_规范数据
                        rpListSo.remove(0);
                        sysCopyRecord.setRpCySo(JSONObject.toJSONString(rpListSo));
                    }

                    List<String> rpListSoYs = wosBasicController.getRpListYs(wosEntity.getCrp());
                    if (rpListSoYs.size() > 0) {
                        //C设置第一通讯_原始数据
                        List<String> list = new ArrayList<>();
                        list.add(rpListSoYs.get(0));
                        sysCopyRecord.setRpCoSoYs(JSONObject.toJSONString(list));
                        //C设置参与通讯_原始数据
                        rpListSoYs.remove(0);
                        sysCopyRecord.setRpCySoYs(JSONObject.toJSONString(rpListSoYs));
                    }

                    String cfuWosEntity = wosEntity.getCfu();
                    if (StringUtil.isNotNull(cfuWosEntity)) {
                        String[] split = cfuWosEntity.split(";");
                        //C设置设置基金_原始数据
                        objectList.addAll(Arrays.asList(split));
                        sysCopyRecord.setFuSoYs(JSONObject.toJSONString(objectList));
                        objectList.clear();
                        for (String fuOne : split) {
                            String ruleName = getRuleName(fuOne, initController.fundRuleFile);
                            if (StringUtil.isNotNull(ruleName)) {
                                objectList.add(ruleName);
                                searchSetFu.add(ruleName);
                            }
                        }
                        sysCopyRecord.setFuSo(JSONObject.toJSONString(objectList));
                        objectList.clear();
                    }

                    sysCopyRecord.setYearSo(wosEntity.getCpy());
                }
            }


            sysCopyRecord.setUnitId(unitBasic.getId());
            sysCopyRecord.setSysCreateTime(LocalDateTime.now());
            sysCopyRecord.setSysUpdateTime(LocalDateTime.now());
            sysCopyRecord.setSearchList(JSONObject.toJSONString(searchSet));
            sysCopyRecord.setSearchListFu(JSONObject.toJSONString(searchSetFu));


            copyRecordMapper.insert(sysCopyRecord);
            System.out.println("增加抄袭记录成功");
        } catch (Exception e) {
            System.out.println("增加抄袭记录报错");
        }


        return new ResultBean<>("");
    }

    /**
     * 获取Wos数据
     *
     * @param id
     */
    public WosEntity wosMsg(String pmut) {


        if (StringUtil.isNotNull(pmut)) {
            //具体的配置参数请参阅Druid官方文档
            DataSource ds = new SimpleDataSource("jdbc:mysql://10.1.1.16:3306/scholar_23_12", "root", "quanfang3.1415");
            try {
                Entity entity = null;
                if (pmut.length() > 10) {
                    entity = Db.use(ds).queryOne("select * from spider_tb_true where `UT` = 'WOS:" + pmut + "' limit 1 ;");
                } else {
                    entity = Db.use(ds).queryOne("select * from spider_tb_true where `PM` = '" + pmut + "' limit 1 ;");
                }
                WosEntity wosEntity = new WosEntity();
                wosEntity.setCTi(entity.getStr("TI"));
                wosEntity.setCco(entity.getStr("C1"));
                wosEntity.setCrp(entity.getStr("RP"));
                wosEntity.setCfu(entity.getStr("FU"));
                wosEntity.setCpy(entity.getStr("PY"));
                wosEntity.setCut(entity.getStr("UT"));
                return wosEntity;
            } catch (SQLException throwables) {
                throwables.printStackTrace();
                return null;
            }
        }
        return null;
    }

//    public static void main(String[] args) throws SQLException {
//        DataSource ds = new SimpleDataSource("jdbc:mysql://10.1.1.16:3306/scholar_23_09", "root", "quanfang3.1415");
//        Entity entity = Db.use(ds).queryOne("select * from spider_tb_true where `PM` = '" + 29555363 + "' limit 1 ;");
//        WosEntity wosEntity = new WosEntity();
//        wosEntity.setCTi(entity.getStr("TI"));
//        wosEntity.setCco(entity.getStr("C1"));
//        wosEntity.setCrp(entity.getStr("RP"));
//        wosEntity.setCfu(entity.getStr("FU"));
//        wosEntity.setCpy(entity.getStr("PY"));
//        System.out.println(wosEntity);
//    }
}
